﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Store/StoreMastePage.Master" AutoEventWireup="true" CodeBehind="ApproveAdjustmentVoucher.aspx.cs" Inherits="logicunivesityinventorystore.Store.ApproveAdjustmentVoucher" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script src="../js/jquery.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(window).bind('load', function () {
            var headerChk = $(".chkHeader input");
            var itemChk = $(".chkItem input");
            headerChk.bind("click", function () {
                itemChk.each(function () { this.checked = headerChk[0].checked; })
            }
                   );
            itemChk.bind("click", function () { if ($(this).checked == false) headerChk[0].checked = false; });
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
   <h1>
        Approve Adjustment Voucher</h1>
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
    <br />
    <center>
    <asp:GridView ID="gvAdjDetails" runat="server" AutoGenerateColumns="False" 
        DataSourceID="ObjectDataSource1" Width="500px" CellPadding="20" 
            DataKeyNames="VoucherID" onrowcommand="GridView1_RowCommand" 
            onrowdatabound="GridView1_RowDataBound">
        <Columns>
            <asp:TemplateField HeaderText="Select">
                <HeaderTemplate>
                    <asp:CheckBox ID="chkHeader" runat="server" CssClass="chkHeader"/>
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:CheckBox ID="chkItem" runat="server" CssClass="chkItem"/>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Voucher Number">
                <ItemTemplate>
                    <asp:LinkButton ID="link_VoucherID" runat="server" 
                        Text='<%# Eval("VoucherID") %>' CommandArgument='<%# Eval("VoucherID") %>' CommandName="Select"></asp:LinkButton>
                      <cc1:ModalPopupExtender ID="ModalPopupExtender1" BackgroundCssClass="modalBackground"
                runat="server" CancelControlID="btnCancel" OkControlID="btnOkay" TargetControlID="link_VoucherID"
                PopupControlID="Panel1" Drag="true" PopupDragHandleControlID="PopupHeader" OnOkScript="NewExpanseOkay();" BehaviorID="EditModalPopup">
                 </cc1:ModalPopupExtender>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField HeaderText="Date Issue" DataField="DateIssue" />
            <asp:BoundField HeaderText="Clerk Name" DataField="ClerkName" />
            <asp:BoundField HeaderText="Price" DataField="Price" />
        </Columns>
        <RowStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="10px" />
    </asp:GridView>
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
        SelectMethod="FindAllPendingAdjustmentVoucher" 
        TypeName="BusinessLogicLayer.AdjustmentVoucherFacade"></asp:ObjectDataSource>
    <br />
        
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:Button ID="btn_Approve" runat="server" Text="Approve" Height="32px" 
        Width="70px" CssClass="ButtonStyle" onclick="btn_Approve_Click" />
        </center>
         <div class="popup_Buttons" style="display: none">
                
                 <input id="btnOkay" value="Done" type="button" />
                <input id="btnCancel" value="Cancel" type="button" />
            </div>
            <div id="Panel1" style="display: none; width:370px;" class="modalPopup">
                <iframe id="frameeditexpanse" frameborder="0" src="VoucherDetails.aspx" height="270" scrolling="auto" width="370"; 
                    ></iframe>
            </div>
         </ContentTemplate>
             </asp:UpdatePanel>
</asp:Content>

<asp:Content ID="Content3" runat="server" 
    contentplaceholderid="ContentPlaceHolder3">
                
                </asp:Content>


<asp:Content ID="Content4" runat="server" 
    contentplaceholderid="ContentPlaceHolder4">
         
                </asp:Content>



<asp:Content ID="Content5" runat="server" 
    contentplaceholderid="ContentPlaceHolder5">

                </asp:Content>




<asp:Content ID="Content6" runat="server" 
    contentplaceholderid="ContentPlaceHolder1">

                </asp:Content>





<asp:Content ID="Content7" runat="server" 
    contentplaceholderid="ContentPlaceHolder7">

                </asp:Content>






<asp:Content ID="Content8" runat="server" 
    contentplaceholderid="ContentPlaceHolder6">
                <h2>Manage Adjustment Voucher</h2>
			    <p>
                <% if (Page.User.IsInRole("DepartmentHead")) { %>
                    <asp:LinkButton ID="lbtnGAV" runat="server" Width="201px" 
                        onclick="lbtnGAV_Click">Generate Adjustment Voucher</asp:LinkButton>
                        <% } %></p>
                    <p>
                    <asp:LinkButton ID="lbtnAAV" runat="server" Width="189px" onclick="lbtnAAV_Click">Approve Adjustment Voucher</asp:LinkButton></p>
		          
                </asp:Content>







